<?php
//ini_set('error_reporting', 'E_ALL & ~E_DEPRECATED');
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once __DIR__ . '/../xml/SiteXmlController.php';

class SiteTest extends UnitTestCase
{
	protected $_testObject;

	public function setUp()
	{
		parent::setUp();
		$this->_testObject = new Models_Site_XmlController();
	}
	/**
	 * サイト情報を保存する
	 */
	public function Test1100()
	{
		echo "start \\r\n";
		$nameTeam = 'FC東京';
		$nameUser = 'yamada';
		$passWord = 'sinsin';
		$mailAddress = 'abc@co.co.jp';
		$ret = $this->_testObject->add($nameTeam, $nameUser, $passWord, $mailAddress);
		$ret = $this->_testObject->getDataset();
		$this->_testObject->saveToFile();
		print_r($ret);

	}

	/**
	 * サイト情報を書き換える
	 */
	public function Test1200()
	{
		echo "test1200\r\n";
		$id = '1357360336.781';
		$arrData = array(
				Models_SiteController::KEY_TEAM_NAME => '横浜マリノス'
				);
		$this->_testObject->replace($arrData, $id);
		$ret = $this->_testObject->getDataset();
		print_r($ret);
	}
}